<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./lib/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <!--   <button @click="isShow=!isShow">新增</button>
      <div v-if="isShow">
        <input type="text" name="" id="" />
      </div> -->
      <div>
        <div v-if="type==1">你好</div>
        <div v-else-if="type==2">阿斯顿发送到2</div>
        <div v-else-if="type==3">阿斯顿发送到3</div>
        <!-- <div v-else>阿斯顿发送到 else</div> -->
        <template v-else>
          <h1>2323</h1>
          <p>2323</p>
        </template>
      </div>

      <div>
        <button @click="type=1">1</button>
        <button @click="type=2">2</button>
        <button @click="type=3">3</button>
        <button @click="type=4">4</button>
      </div>

      <!--   <div>
        <div>
          <div v-show="pagenum==1">新闻111</div>
          <div v-show="pagenum==2">历史111</div>
        </div>
        <button @click="pagenum=1">新闻</button>
        <button @click="pagenum=2">历史</button>
      </div> -->
    </div>

    <script>
      new Vue({
        el: "#app",
        data() {
          return {
            isShow: false,
            type: 1,
            pagenum: 1,
            arr: [
              {
                id: 1,
                name: "社会新闻",
                children: [
                  { id: 2, name: "油价上涨了" },
                  { id: 3, name: "该核酸检测了" },
                ],
              },
              {
                id: 4,
                name: "娱乐新闻",
                children: [
                  { id: 5, name: "周杰伦发歌了" },
                  { id: 6, name: "周杰伦销量第一了" },
                ],
              },
            ],
          };
        },
        methods: {},
      });
    </script>
  </body>
</html>
